import React, { useState } from "react"
import service from "@@/services/user.service"
import { BaseEventOrig, Image, Picker, Text, View } from "@tarojs/components"
import {
  useDidHide,
  useDidShow,
  usePageScroll,
  usePullDownRefresh,
  useReachBottom,
  useReady,
  useResize,
  useTabItemTap,
  pageScrollTo,
  navigateTo,
} from "@tarojs/taro"
import NavLayout from "@@/components/layout/nav.layout"
import "./smb.scss"


const Index = () => {
  useDidShow(() => {
    pageScrollTo({
      selector: "#smbPage",
      scrollTop: -100,
    })
  })
  const goProduct = (id: string, menu: string) => () => {
    navigateTo({
      url: `/pages/productList/productList?id=${id}&oneMenu=${menu}`
    })
  }

  return (
    <NavLayout title={"大华股份"} border leftIconType="chevron-left" color="#141414" id="smbPage">
      <View className={"smb_bg"}>
        <View className={"smb_box"}>
          <View className={"item_box zonghe"} onClick={goProduct("130", "综合")}>
            <View className={"title"}>综合</View>
            <View className={'img_box'}><Image mode={"aspectFit"} src={require('@@/assets/img/product/zonghe.png')} /></View>
          </View>
          <View className={"item_box dichan"} onClick={goProduct("132", "地产")}>
            <View className={"title"}>地产</View>
            <View className={'img_box'}><Image mode={"aspectFit"} src={require('@@/assets/img/product/dichan.png')} /></View>
          </View>
          <View className={"item_box wenwei"} onClick={goProduct("131", "文旅卫生")}>
            <View className={"title"}>文旅卫生</View>
            <View className={'img_box'}><Image mode={"aspectFit"} src={require('@@/assets/img/product/wenwei.png')} /></View>
          </View>
          <View className={"item_box jiaoyu"} onClick={goProduct("134", "教育")}>
            <View className={"title"}>教育</View>
            <View className={'img_box'}><Image mode={"aspectFit"} src={require('@@/assets/img/product/jiaoyu.png')} /></View>
          </View>
          <View className={"item_box nongmo"} onClick={goProduct("133", "农林牧渔")}>
            <View className={"title"}>农林牧渔</View>
            <View className={'img_box'}><Image mode={"aspectFit"} src={require('@@/assets/img/product/nongmo.png')} /></View>
          </View>
          <View className={"item_box chanye"} onClick={goProduct("135", "企业园区")}>
            <View className={"title"}>企业园区</View>
            <View className={'img_box'}><Image mode={"aspectFit"} src={require('@@/assets/img/product/chanye.png')} /></View>
          </View>
          <View className={"item_box lingshou"} onClick={goProduct("136", "零售")}>
            <View className={"title"}>零售</View>
            <View className={'img_box'}><Image mode={"aspectFit"} src={require('@@/assets/img/product/lingshou.png')} /></View>
          </View>
        </View>
      </View>
    </NavLayout>
  )
}

export default Index
